package model

type SysUser struct {
	DcModel
	EmpeeAcct string       `json:"empee_acct" gorm:"comment:工号;not null;uniqueIndex;"`
	StaffName string       `json:"staff_name" gorm:"comment:员工姓名;not null;index"`
	StaffId   string       `json:"staff_id" gorm:"comment:员工ID;not null;uniqueIndex"`
	Password  string       `json:"-"  gorm:"comment:用户密码;"`
	Mobile    string       `json:"mobile" gorm:"comment:手机号;"`
	Email     string       `json:"email" gorm:"comment:邮箱;"`
	CertiNbr  string       `json:"certi_nbr" gorm:"comment:证件号码;"`
	OrgRole   []SysOrgRole `json:"org_role" gorm:"many2many:sys_user_org_role;foreignKey:EmpeeAcct;joinForeignKey:EmpeeAcct;references:OrgRoleCode;joinReferences:OrgRoleCode;"`
}

type RequestGetUserList struct {
	RequestPageAndSort
	EmpeeAcct string `json:"empee_acct"`
	StaffName string `json:"staff_name"`
	Mobile    string `json:"mobile"`
	Source    string `json:"source"`
	Status    string `json:"status"`
}

type RequestAddUser struct {
	RequestAdd
	EmpeeAcct string `json:"empee_acct"`
	StaffName string `json:"staff_name"`
	StaffId   string `json:"staff_id"`
	Mobile    string `json:"mobile"`
	Email     string `json:"email"`
}

type RequestChangePassword struct {
	OldPassword  string `json:"old_password" binding:"required"`
	NewPassword1 string `json:"new_password_1" binding:"required"`
	NewPassword2 string `json:"new_password_2" binding:"required"`
}

type RequestChangeNickname struct {
	Nickname string `json:"nickname" binding:"required"`
}
